/**
 * small-spring
 *
 * @author yuanchen
 * @date 2021-06-29 16:34
 */
package cn.bugstack.springframework.beans.factory.support;


import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author yuanchen
 * @date 2021-06-29 16:34
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {

    private Map<String,Object> singletonObjects=new HashMap<>();

    @Override
    public Object getSingleton(String beanName) {
        return singletonObjects.get(beanName);
    }

    protected void addSingleton(String beanName,Object bean){
        singletonObjects.put(beanName,bean);
    }
}
